import * as React from 'react';
import classNames from 'classnames';

export interface RowProps {
	children?: React.ReactNode;
	className?: string;
	align?: 'top' | 'middle' | 'bottom' | 'stretch';
	justify?: 'start' | 'end' | 'center' | 'space-around' | 'space-between';
	wrap?: boolean;
}

const Row: React.FC<RowProps> = props => {
	const prefixCls = 'bh-row';
	const {
		children,
		className,
		align,
		justify,
		wrap,
		...restProps
	} = props;
	const classString = classNames(
		prefixCls,
		className,
		{
			[`${prefixCls}-${align}`]: align,
			[`${prefixCls}-${justify}`]: justify,
			[`${prefixCls}-no-wrap`]: wrap === false,
		}
	);

	return (
		<div {...restProps} className={classString}>
		    {children}
		</div>
	)
};

export default Row;